﻿{include file="public/header"}
<title>问题修改</title>
</head>
<body>

<style>
    .form-label{
        width: 15% !important;
    }
</style>
<article class="page-container">
    <form action="" method="post" class="form form-horizontal" >
        <div class="ch-row ch-info-form">
            <div class="flex1">标题：</div>
            <div class="flex3">
                <input type="text" name="product_title" class="title form-control" value="{$data.product_title}">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">适用场景：</div>
            <div class="flex3">
                <textarea name="scesn" class="form-control">{$data.scesn}</textarea>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">温馨提示：</div>
            <div class="flex3">
                <textarea name="prompts" class="form-control">{$data.prompts}</textarea>
            </div>
        </div>
        
        <div class="ch-row ch-info-form">
            <div class="flex1">产品状态：</div>
            <div class="flex3 ch-pc-row">
                <div class="ch-radio">
                    <input type="radio" id="ch-radio1" name="pro_types"  <?php if($data['pro_types']==0){?>checked="checked" <?php }?> value="0">
                    <label for="ch-radio1">暂不开放</label>
                </div>
                <div class="ch-radio">
                    <input type="radio" id="ch-radio2" name="pro_types" <?php if($data['pro_types']==1){?>checked="checked" <?php }?> value="1">
                    <label for="ch-radio2">已上线</label>
                </div>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">产品定价：</div>
            <div class="flex3">
                <input type="text"  name="prices"  value="{$data.prices}" class="form-control">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">计价规则：</div>
            <div class="flex3">
                <textarea name="price_rules" class="form-control">{$data.price_rules}</textarea>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">单位：</div>
            <div class="flex3">
                <select name="units_id" class="form-control">
                    <option selected="selected" value="{$data.units_id}">{$data.title}</option>
                    {volist name='g' id='v'}
                    <option value="{$v.id}">{$v.title}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">服务内容：</div>
            <div class="flex3">
                <textarea name="service_contents" class="form-control">{$data.service_contents}</textarea>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">使用材料：</div>
            <div class="flex3">
                <textarea name="materials" class="form-control">{$data.materials}</textarea>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">服务工期：</div>
            <input type="hidden" value="{$data.parents_id}" name="parents_id">
            <input type="hidden" value="{$data.product_id}" name="product_id">
            <div class="flex3">
                <input type="text"  name="service_timess"  value="{$data.service_timess}" class="form-control">
            </div>
        </div>
        <div class="ch-row">
            <div class="flex1">
                <button class="btn btn-primary radius" style="width: 100%;" type="button"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
            </div>
        </div>
    </form>
</article>

{include file="public/footer"}
<script>
    $('.radius').click(function () {

        var src="{:Url('index/Product/edi')}";
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data:$('form').serializeArray(),
                success: function (data) {
                    var res=JSON.parse(data);
                    if(res.code==200){


                        layer.closeAll();
                            window.parent.location.reload();


                    }else{
                        layer.msg(res.msg,{icon: 5,time:1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });



    });
</script>
</body>
</html>